import axios from "axios";
// axios.defaults.baseURL="";
const instance=axios.create({
    baseURL:"/apicdf",
    timeout:20000
});
instance.interceptors.request.use((config)=>{
    const token = sessionStorage.getItem('user-token');
    // console.log(token);
    if (token) {
      config.headers.Authorization = `Bearer ${token}`;
    }
    return config;
})

// 响应拦截器
instance.interceptors.response.use((res)=>{
    return res;
},(err)=>{
    console.log(err);
})
export default instance 